﻿using System;
using System.Collections.Generic;
using System.ServiceModel;

namespace YLPublicService
{
    //除了登录都要使用guid验证
    [ServiceContract]
    public interface IUserService : IServiceBase
    {
        /// <summary>
        /// 获取已完成工作项ftp服务器中地址
        /// </summary>
        /// <param name="itemName"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        string GetFinishFileServerPath(int workItemID, Guid guid);


        /// <summary>
        /// 获取用户帐户信息
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        TransferModel.UserAccount GetAccount(Guid guid);

        /// <summary>
        /// 获取用户所有工作项的时间
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        DateTime[] GetUserWorkItemDates(Guid guid);

        /// <summary>
        /// 获取所有工作记录项
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        IEnumerable<TransferModel.WorkItem> GetWorkItems(Guid guid);
        /// <summary>
        /// 获取一段时间内的所有工作记录项,使用DBTime 作判断
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract(Name = "GetWorkItemsByDate")]
        IEnumerable<TransferModel.WorkItem> GetWorkItems(DateTime start, DateTime end, Guid guid);
        /// <summary>
        /// 添加工作记录项,返回工作项id 
        /// </summary>
        [OperationContract]
        int AddWorkItem(TransferModel.WorkItem item, Guid guid);
        [OperationContract]
        bool UpdatedWorkItemStatus(TransferModel.WorkItem item, TransferModel.WorkItemStatus newStatus, Guid guid);
        /// <summary>
        /// 获取该用户时间范围内已完成项目
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="guid"></param>
        /// <returns></returns>
        [OperationContract]
        TransferModel.WorkItem[] GetFinishWorkItems(DateTime start, DateTime end, Guid guid);

    }
}
